<template>
  <!-- python gen: {timestamp}  -->
  <div class="yj-data-form">
    <el-form
      size="medium"
      type="flex"
      :disabled="formDisableFlag"
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      label-width="200px"
    >
      <!-- 
          <el-col :sm="12">
          <el-form-item prop="JRXKZH" label="金融许可证号">
            <el-input
              style="width: 300px"
              v-model.trim="ruleForm.JRXKZH"
            ></el-input>
          </el-form-item>
        </el-col> -->

      {formCol}
    </el-form>
  </div>
</template>

<script>
export default {
  name: "{tnameLow}Form",
  props: ["flag", "item"],
  data() {
    return {
      formDisableFlag: false,
      ruleForm: {
        CHECK_ID: "",
        #ruleForm#
      },
      rules: {
        CHECK_ID: [
          // { required: true, message: "不能为空", trigger: "blur" }
        ],

        #rule#
      },
    };
  },
  methods: {
    goAdd() {
      Object.keys(this.ruleForm).forEach(key => (this.ruleForm[key] = ""));
      this.ruleForm.enabled = true;
    },
    goUpdate() {
      //   Object.keys(this.ruleForm).forEach(key => (this.ruleForm[key] = ""));
      //   //   this.dialogFormVisible = true;
      //   this.ruleForm.enabled = true;
    },
    validateIt() {
      this.$refs["ruleForm"].validate(valid => {
        if (valid) {
          this.$emit("goSave", null);
        }
      });
    }
  },
  mounted() {
    this.ruleForm = this.item;
    if ("add" === this.flag) {
      this.goAdd();
    }
    if ("view" === this.flag) {
      this.formDisableFlag = true;
    }

    // if ("update" === this.flag) {
    //   this.goUpdate();
    // }
  }
};
</script>

<style scoped>
/* .yj-data-form { */
/* border: 2px solid green; */
/* width: 800px; */
/* margin: 2px auto; */
/* } */
</style>
